package cn.kgc.springboot.controller;

import cn.kgc.springboot.entity.User;
import cn.kgc.springboot.http.ResponseResult;
import cn.kgc.springboot.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
//http请求方式 get post delete put
@RestController
@RequestMapping("user")
public class UserController {
    @Resource
    private UserService userService;
//处理get方式的http请求
    @GetMapping("list")
    public ResponseResult userList(){
        return ResponseResult.success().data("tableData",userService.list());
    }
}
